import { hopeTheme } from "vuepress-theme-hope";
import navbar from "./navbar.js";
import sidebar from "./sidebar.js";

export default hopeTheme(
  {
    hostname: "https://lk7.gitee.io",

    author: {
      name: "老K",
    },

    iconAssets: "//at.alicdn.com/t/c/font_4328379_v6ejfzfe09.css",
    iconPrefix: "iconfont ",
    logo: "/logo.svg",

    // navbar
    navbar,

    // sidebar
    sidebar,

    footer: "老K",

    displayFooter: true,

    blog: {
      avatar: "/assets/images/avatar.jpg",
      roundAvatar: true,
      description: "一个前端开发者",
      intro: "/intro.html",
    },

    encrypt: {
      config: {
        "/demo/encrypt.html": ["1234"],
      },
    },

    plugins: {
      blog: true,

      // install @waline/client before enabling it
      // WARNING: This is a test server for demo only.
      // You should create and use your own comment service in production.
      // comment: {
      //   provider: "Waline",
      //   serverURL: "https://waline-comment.vuejs.press",
      // },

      // all features are enabled for demo, only preserve features you need here
      mdEnhance: {
        align: true,
        attrs: true,

        // install chart.js before enabling it
        // chart: true,

        codetabs: true,

        // insert component easily
        // component: true,

        demo: true,

        // install echarts before enabling it
        // echarts: true,

        figure: true,

        // install flowchart.ts before enabling it
        // flowchart: true,

        // gfm requires mathjax-full to provide tex support
        // gfm: true,

        imgLazyload: true,
        imgSize: true,
        include: true,

        // install katex before enabling it
        // katex: true,

        // install mathjax-full before enabling it
        // mathjax: true,

        mark: true,

        // install mermaid before enabling it
        // mermaid: true,

        playground: {
          presets: ["ts", "vue"],
        },

        // install reveal.js before enabling it
        // revealJs: {
        //   plugins: ["highlight", "math", "search", "notes", "zoom"],
        // },

        stylize: [
          {
            matcher: "Recommended",
            replacer: ({ tag }) => {
              if (tag === "em")
                return {
                  tag: "Badge",
                  attrs: { type: "tip" },
                  content: "Recommended",
                };
            },
          },
        ],
        sub: true,
        sup: true,
        tabs: true,
        vPre: true,

        // install @vue/repl before enabling it
        // vuePlayground: true,
      },

    },
  },
  { custom: true },
);
